#include<string>
#include<iostream>
#include<mutex>
#include<cstdio>
#include<fstream>
#include <fcntl.h>
#include <unistd.h>
#include <sys/file.h>
#include<vector>
#include <semaphore.h>
#include <sys/stat.h>
#include<thread>
#include<Recorder.h>
#include<functional>
#include<mutex>
#include<thread>

class ExeRecorder:public Recorder{
private:
    std::vector<std::thread> threads; 
    bool flag = 1;
    std::function<void(ExeRecorder*,std::string)> callback;
    std::mutex mx;

    void clear(int pid);
    void read(int pid);//读取指定进程的文件数据

public:
    ExeRecorder(std::string path);
    ~ExeRecorder();
    bool write(std::string front, std::string name1, std::string name2);
    void setCallBack(std::function<void(ExeRecorder*,std::string)> callback);//接收到的数据怎么处理，
    void run(std::vector<int> pids);
    //void  stop();
};
